package com.study.d4_thread;

public class Test4 {
    public static void main(String[] args)throws Exception {
/*        for (int i = 0; i < 3; i++) {
            System.out.println(i);
            Thread.sleep(1000);
        }*/

        Thread t = new MyThread("sb");
        t.start();
        for (int i = 0; i < 5; i++) {
            if(i==2)t.join();//让t先插队执行完毕！
        }
        for (int i = 0; i < 4; i++) {
            System.out.println("main:"+i);
        }
    }
}
